<?php
/**
 * 微信公众号消息交互
 * @author flaravel
 */

namespace App\Http\Controllers\Wechat;

use App\Http\Controllers\Controller;
use App\Service\Wechat\WechatEvent;
use EasyWeChat\Kernel\Messages\Message;
use Illuminate\Http\Request;

class WxController extends Controller
{

    /**
     * 与公众号微信服务端进行交互
     */
    public function index()
    {
        $app = app('wechat.official_account');

        //event事件
        $app->server->push(WechatEvent::class, Message::EVENT);

        return $app->server->serve();
    }
}
